import { toast } from './../toast';
function clipboardSuccess() {
    toast.success('复制成功');
}
function clipboardError() {
    toast('复制失败');
}
export const setClipboard = (txt, options) => {
    uni.setClipboardData({
        data: String(txt),
        success: () => {
            options?.success ? options.success() : clipboardSuccess();
        },
        fail: (err) => {
            options?.error ? options.error(err.errMsg) : clipboardError();
        },
    });
};
